﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Niknak.Services.ServiceCore.Msmq
{
    /// <summary>
    /// Describes an operation running in a thread as a result of a message arriving from the queue
    /// </summary>
    /// <typeparam name="MessageTypeEnum">Enum type describing possible operations - see http://stackoverflow.com/questions/6438352/using-enum-as-generic-type-parameter-in-c-sharp</typeparam>
    public class ThreadedOperation<MessageTypeEnum>
        where MessageTypeEnum : struct, IComparable, IConvertible, IFormattable
    {
        /// <summary>
        /// Enum describing the type of operation
        /// </summary>
        public MessageTypeEnum MessageType { get; set; }
        /// <summary>
        /// Body of the queue message
        /// </summary>
        public object Body { get; set; }
    }
}
